﻿@{
    ViewBag.Title = "CategoryList";
}

<div id="cphMain_ctl00_ContentPane" class="center">
    <div id="Breadcrumb" class="Breadcrumb">
        <ul>
            <li class="first">
                <a href='javascript:;' onclick="javascript:loadAction('personal','Account')">
                    Tài khoản của tôi
                </a>
            </li>            
            <li>
                <span>Danh sách công ty</span>
            </li>
        </ul>
    </div>

<div class="Account-Module DefaultModule">
    
<div class="Block DefaultModule">
    

    <div id="CartHeader" class="Block Moveable Panel">
        <h2>
            Danh sách công ty
        </h2>
    </div>

    <div id="CartContainer" class="Block Moveable Panel">

        <div class="BlockContent">
            @if (ViewBag.cateList != null)
            {
                
                    <div class="Clear">
                        <div class="FloatRight">
                            <a href="javascript:;" onclick="javascrip:loadAction('CategoryDetail','Admin')" 
                                class="myBtn1">Thêm công ty mới</a>
                        </div>
                    </div>

                    <div class="Clear">
                    </div>

                    <div>
                        <div>

                            <table class="CartContents" cellspacing="0" rules="rows" border="1" id="cphMain_ctl00_ctl01_ctl00_grvList" style="width: 100%; border-collapse: collapse;">
                                <tbody>
                                    <tr class="even-row">
                                        <th  scope="col">Công ty
                                        </th>
                                        <th>
                                            Hình ảnh
                                        </th>
                                        <th scope="col">Địa chỉ
                                        </th>
                                        <th  scope="col">Số điện thoại
                                        </th>                                        
                                        <th scope="col">&nbsp;</th>
                                    </tr>
                                    @{var rowCount = 0; string cssRowClass = "";}
                                    @foreach (var cate in ViewBag.cateList)
                                    {
                                        if (++rowCount % 2 == 1) { cssRowClass = "old-row"; }
                                        else { cssRowClass = "even-row"; }
                                        <tr class="@cssRowClass">
                                            <td >
                                                <a href="javascript:;" onclick="javascript:viewCategoryDetail(@cate.ID)">
                                                    <strong>@cate.name</strong></a>                                                
                                                <br>                                                                                                
                                            </td>
                                            <td align="center">
                                                <a href="javascript:;" onclick="javascript:viewCategoryDetail(@cate.ID)">
                                                    <img src="/Content/data/images/categories/@cate.image_link" height="80"/>
                                                </a>
                                            </td>
                                            <td  style="width: 120px;">
                                                <span>@cate.address</span>
                                            </td>
                                            <td style="width: 100px;">                                                
                                                <span>@cate.phone_number</span>
                                            </td>                                            
                                            <td  style="width: 1px;">
                                                <a href="javascript:;" onclick="javascript:deleteCategory(@cate.ID)" class="myBtn1">Xóa</a>
                                            </td>
                                        </tr>
                                    }
                                </tbody>
                            </table>

                        </div>

                    </div>

                    
                
            }
            
        </div>
    </div>        
</div>


</div>
</div>
